/*
============================================================================
Name        : CVersificatorContainer from VersificatorContainer.h
Author      : 
Version     :
Copyright   : Your copyright notice
Description : Declares container control for application.
============================================================================
*/

#ifndef __VERSIFICATORCONTAINER_H__
#define __VERSIFICATORCONTAINER_H__

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <coecntrl.h>		//CCoeControl
#include <gdi.h>			//TRgb

#include "MPluginContainer.h"

// FORWARD DECLARATIONS
class CVersificatorAppUi;
class CFbsBitmap;
class CTicker;

// CLASS DECLARATION
class CVersificatorContainer :	public CCoeControl, 
								public MPluginContainer
{
public:
	CVersificatorContainer(CVersificatorAppUi& aAppUi);
	~CVersificatorContainer();
	void ConstructL(const TRect& aRect);

private: // Functions from base classes
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;

	void Draw(const TRect& aRect) const;


public: //from MPluginContainer
	void SetTitle(const TDesC& aTitle);
	void SetColors(TRgb aBackBorderColor, TRgb aBackShadowColor, TRgb aBackColor, TRgb aInsideBorderColor, TRgb aInsideColor, TRgb aForeColor);
	void SetTickerIcon(CFbsBitmap* aIconBitmap, CFbsBitmap* aIconBitmapMask);
	void SetTickerText(const TDesC& aText);
	void SetTickerTextFormat(TRefByValue<const TDesC16> aFmt, ...);
	void Repaint();


public: // New functions
	void SetVolume(TInt aVolume);


private: //new functions
	void CreateControlsL();


private: //data
	//AppUi
	CVersificatorAppUi& iAppUi;

	//Title
	HBufC* iTitle;

	//Colors
	TRgb iBackBorderColor;
	TRgb iBackShadowColor;
	TRgb iBackColor;
	TRgb iInsideBorderColor;
	TRgb iInsideColor;
	TRgb iForeColor;

	//Icon bitmaps
	CFbsBitmap* iIconBitmap;
	CFbsBitmap* iIconBitmapMask;

	//Ticker
	CTicker* iTicker;

	//Fonts
	CFont* iTextFont;
	CFont* iTitleFont;

	//Font dimensions
	TInt iTextFontHeight;
	TInt iTitleFontHeight;
	TInt iTitleWidth;
	TInt iTickerWidth;

	//Check if draw is deferred
	TTime iLastDrawTime;
};

#endif
